package com.yskj.dngame.kotiledemo.util

import com.orhanobut.logger.Logger


/**
 * 打印输出工具
 * Created by SYZ
on 2017/8/29.
 */
class LogUtil {


    companion object {
        //是否允许日志输出
        private val mDebuggable: Boolean = true
        //        private val mDebuggable: Boolean = false
        //log 输入日志名字
        private val logName = "pay"

        /**
         * 输出 d 级别log
         */
        fun d(msg: String) {
            if (mDebuggable)
                Logger.t(logName).d(msg)
        }

        /**
         * 输出 W 级别log
         */
        fun w(msg: String) {
            if (mDebuggable)
                Logger.t(logName).w(msg)
        }

        /**
         * 输出 I 级别log
         */
        fun i(msg: String) {
            if (mDebuggable)
                Logger.t(logName).i(msg)
        }

        /**
         * 输出 V 级别log
         */
        fun v(msg: String) {
            if (mDebuggable)
                Logger.t(logName).v(msg)
        }

        /**
         * 输出 E 级别log
         */
        fun e(msg: String?, throwable: Throwable?) {
            if (mDebuggable)
                Logger.t(logName).v(msg + " : " + throwable.toString())
        }

    }
}